package com.zz.parkingsystem.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.Objects;

/**
 * @author wangyuxiang
 */
@Data
public class CarMessageVO {

    /**
     * 车辆id
     */
    private Integer carId;
    /**
     * 车牌号
     */
    private String carLicensePlate;
    /**
     * 车牌类型：0：蓝,1:黄,2,黑,3:绿,4,白
     */
    private String clLicenseType;
    /**
     * 用户名
     */
    private String userName;
    /**
     * 绑定时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date carBindTime;
    /**
     * 正常订单数数量
     */
    private Integer a;
    /**
     * 异常订单数数量
     */
    private Integer b;
    /**
     * 正常消费金额
     */
    private Long c;
    /**
     * 异常消费金额
     */
    private Long d;
    /**
     * 用户id
     */
    private Integer userId;


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CarMessageVO that = (CarMessageVO) o;
        return Objects.equals(carId, that.carId) && Objects.equals(carLicensePlate, that.carLicensePlate) && Objects.equals(clLicenseType, that.clLicenseType) && Objects.equals(userName, that.userName) && Objects.equals(carBindTime, that.carBindTime) && Objects.equals(a, that.a) && Objects.equals(b, that.b) && Objects.equals(c, that.c) && Objects.equals(d, that.d);
    }

    @Override
    public int hashCode() {
        return Objects.hash(carId, carLicensePlate, clLicenseType, userName, carBindTime, a, b, c, d);
    }
}
